package day06;

public class Demo05 {
    static volatile boolean running = true;
    static int n = 0;
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(){
            @Override
            public void run() {
                while (running){
                    n++;
                }
                System.out.println("Over");
            }
        };
        t.start();
        Thread.sleep(1000);
        running = false;
        System.out.println(n);
        System.out.println(running);
        System.out.println("Main 结束!");
    }
}
